<include file="Public:header" />
<link rel="stylesheet" type="text/css" href="../Public/js/calendar/jscal2.css"/>
<link rel="stylesheet" type="text/css" href="../Public/js/calendar/border-radius.css"/>
<link rel="stylesheet" type="text/css" href="../Public/js/calendar/win2k.css"/>
<script type="text/javascript" src="../Public/js/calendar/calendar.js"></script>
<script type="text/javascript" src="../Public/js/calendar/lang/en.js"></script>
<script>  
$(document).ready(function() {   
	$('[fs]').inputDefault();
});  
</script> 

<div class="main">
    <div class="box_tit">
        <h2>货券列表</h2>
    </div>
    
	
    <div class="sc_tp clearfix">
   		<form method="post" action="{:U('Coupon/index')}">
    	<p><span class="f_l f_s2 f_w sc_tit">货券搜索</span></p>
   		
       	<p class="m_t1">
  			<label class="" for="number"><font class="m_t8">货券编号：</font></label> <input type="text" name="number" id="number" title="货券编号" class="ipa2" value="{$number}">

  			<label class="m_l1" for="type_id"><font class="m_t8">货券类型：</font></label> 
			<select name="type_id" id="type_id" class="ipa6">
				<option value="" selected="selected">不限货券类型</option>
				<volist name="type_list" id="mvo">
					<if condition="$key eq $type_id">   
					<option value="{$key}" selected="selected">
					<else />
					<option value="{$key}">
					</if>   
					{$mvo}
					</option>
				</volist>
			</select>
  			
			<label class="m_l1" for="s_is_used"><font class="m_t8">使用状态：</font></label> 
  			<select name="s_is_used" id="s_is_used" class="ipa6">
				<option value="" selected="selected">不限使用状态</option>
				<option value="1" <if condition="$s_is_used eq 1">selected="selected"</if> >未使用</option>
				<option value="2" <if condition="$s_is_used eq 2">selected="selected"</if> >已使用</option>
			</select>
			
			<label class="m_l1" for="s_status"><font class="m_t8">货券状态：</font></label> 
  			<select name="s_status" id="s_status" class="ipa6">
				<option value="" selected="selected">不限货券状态</option>
				<option value="1" <if condition="$s_status eq 1">selected="selected"</if> >禁用</option>
				<option value="2" <if condition="$s_status eq 2">selected="selected"</if> >启用</option>
			</select>
		</p>
		
		<p class="m_t1">		
			<label class="" for="s_is_actived"><font class="m_t8">销售状态：</font></label> 
			<select name="s_is_actived" id="s_is_actived" class="ipa6">
				<option value="" selected="selected">不限销售状态</option>
				<option value="1" <if condition="$s_is_actived eq 1">selected="selected"</if> >未销售</option>
				<option value="2" <if condition="$s_is_actived eq 2">selected="selected"</if> >已销售</option>
			</select>
			
			<label class="m_l1" for="s_start_time"><font class="m_t8">销售时间：</font></label> 
           	<input type="text" name="s_start_time" title="开始时间" value="{$s_start_time|toDate='Y-m-d H:i'}" id="s_start_time" class="ipa2">
	        <script type="text/javascript">
	            Calendar.setup({
	                weekNumbers: true,
	                inputField : "s_start_time",
	                trigger    : "s_start_time",
	                dateFormat: "%Y-%m-%d %H:%M",
	                showTime: true,
	                minuteStep: 1,
	                onSelect   : function() {
	                	this.hide();
	                	$("#s_start_time").next('label').hide();    
	                }
	            });
	        </script>
	        
	        <label class="" for="s_end_time"><font class="m_t8">~</font></label> 
	        <input type="text" name="s_end_time" title="销售结束时间" value="{$s_end_time|toDate='Y-m-d H:i'}" id="s_end_time" class="ipa2">
	        <script type="text/javascript">
	            Calendar.setup({
	                weekNumbers: true,
	                inputField : "s_end_time",
	                trigger    : "s_end_time",
	                dateFormat: "%Y-%m-%d %H:%M",
	                showTime: true,
	                minuteStep: 1,
	                onSelect   : function() {
	                	this.hide();
	                	$("#s_end_time").next('label').hide();    
	                }
	            });
	        </script>
	        
	        <label class="m_l1" for="merchant_id"><font class="m_t8">销售商：</font></label> 
			<select name="merchant_id" id="merchant_id" class="ipa6">
				<option value="" selected="selected">不限销售商</option>
				<volist name="merchant_list" id="mvo">
					<if condition="$key eq $merchant_id">   
					<option value="{$key}" selected="selected">
					<else />
					<option value="{$key}">
					</if>   
					{$mvo}
					</option>
				</volist>
			</select>
			
		</p>
	
    	<div class="m_t2 clearfix">
    		<input type="submit" class="submit btn5 ml0" value="查  询">
            <input type="submit" class="submit btn5" name="export" value="导  出">
            <input type="button" class="submit btn5" onclick="add()"  value="添加">
    	</div>
    	</form>
		
		<div class="m_t2 clearfix">
			<div class="fLeft" style="width:400px;">
	            <form method="post" action="{:U('Coupon/export')}" enctype="multipart/form-data">
	            	<input type="file" class="thumb_search mln" name="coupon_list"  />
	            	<input type="submit" class="submit btn5" value="导 入">
	            	<a href="{:U('Coupon/export_csv')}" target="_blank" >下载导入格式</a>
	            </form>
	        </div>
	        <div class="fLeft" style="width:400px;">
	            <form method="post" action="{:U('Coupon/doactive_csv')}" enctype="multipart/form-data">
	            	<input type="file" class="thumb_search" name="coupon_list"  />
	            	<input type="submit" class="submit btn5" value="批量激活">
	            	<a href="{:U('Coupon/active_csv')}" target="_blank" >下载批量激活格式</a>
	            </form>
	        </div>    
	   	</div>
		
    </div>
    
    <!--div class="operate">
        <div class="fLeft"><input type="button" onclick="add()" class="submit btn5 mr0" value="添加"></div>
        <div class="fLeft"><input type="button" onclick="foreverdel()" class="submit btn5" value="删除选中"></div>
    </div-->
    
    
    
    

    
    
    <div class="list">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tbody>
            <tr class="nbg">
                <!-- th><input type="checkbox" id="check"></th -->
                <th>编号</th>
                <th>货券编号</th>
                <th>货券类型</th>
				<th>货券价格</th>
                <th>销售信息</th>
                <th>销售时间</th>
                <th>使用状态</th>
                <th>货券状态</th>
                <th>操作</th>
            </tr>
            <volist name="list" id="vo">
            <tr>
                <!-- td><input type="checkbox" name="key" value="{$vo.id}"></td -->
                <td>{$vo.id}</td>
                <td>{$vo.number}</td>
                <td>{$vo.type_id|coupon_type}货券</td>
				<td>{$vo.type_id|coupon_price}元</td>
                <td>{$vo.id|getCouponSold}</td>
                <td><empty name="vo.is_actived">未销售<else/>{$vo.sold_time|toDate='y-m-d'}</empty></td>
                <td>{$vo.is_used|getCouponUsedStatus}</td>
                <td>{$vo.status|getStatus}</td>
                <td><empty name="vo.is_actived"><a href="{:U('Coupon/active',array('id'=>$vo['id']))}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;激活</a>&nbsp;&nbsp;&nbsp;&nbsp;<else/><a href="{:U('Coupon/cancle_active',array('id'=>$vo['id']))}" alt="取消激活">取消激活</a>&nbsp;&nbsp;&nbsp;&nbsp;</empty><a href="{:U('Coupon/edit',array('id'=>$vo['id']))}">修改</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="{:U('Coupon/foreverdelete',array('id'=>$vo['id']))}" onclick="foreverdel({$vo['id']}); return false;">删除</a></td>
            </tr>
            </volist>
            </tbody>
        </table>
        <div class="th" style="clear: both;">{$page}</div>
    </div>
</div>
<include file="Public:footer" />